import VueRouter from "vue-router";

import Vue from "vue";
import LayoutView from "@/view/LayoutView.vue";
import BooksView from "@/view/BooksView.vue";
import AboutView from "@/view/AboutView.vue";
import HomeView from "@/view/HomeView.vue";
const routes = [
  {
    path: "/",
    component: LayoutView,
    redirect: "/home",
    children: [
      {
        path: "/home",
        component: HomeView,
      },
      {
        path: "/books",
        component: BooksView,
      },
      {
        path: "/about",
        component: AboutView,
      },
    ],
  },
];

Vue.use(VueRouter);
const router = new VueRouter({
  mode: "history",
  routes,
});

export default router;
